/*
 * Copyright (C) 2018 Weibo, Inc. All Rights Reserved.
 */
package com.fzy.common.enums;

/**
 * 异常错误码
 *
 * @author zhaoyang10
 * @date 2019/12/3
 */
public enum ErrorCode {
    //成功
    SUCCESS(0, "SUCCESS"),

    //检验入参合法性相关错误码 10000开头
    PARAM_NOT_LEGAL(10000, "参数不合法"),
    DATA_NOT_EXIST(10001, "数据不存在"),
    PARAM_LENGTH_NOT_LEGAL(10002, "字符串长度不合法"),
    ENUM_CODE_NOT_EXIST(10003, "此枚举数据不存在"),
    MOBILE_INVALID_ERROR(10004, "手机号不合法"),
    PARAM_BLANK_ERROR(10005, "参数为空"),
    PARAM_INT_CAN_NOT_NEGATIVE(10006, "数字不能为负值"),
    PARAM_DATE_FORMAT_ERROR(10007, "日期格式不正确"),
    PARAM_DATE_PARSE_ERROR(10008, "日期转换失败"),
    ACCOUNT_STATUS_ERROR(10009, "广告主开户状态不合法"),
    AGENT_UID_ERROR(10010, "请输入您服务的广告主UID"),
    NOT_ZERO_RECHARGE(10011, "不允许负值充值"),
    USER_STATUS_ERROR(10012, "用户状态不合法"),
    ACTIVE_STATUS_ERROR(10013, "广告主未激活"),
    AGENT_USER_STATUS_ERROR(10014, "代理商用户状态不合法"),
    ADVERTISER_TRANSFER_MODE_NOT_LEGAL_ERROR(10015, "广告主转户不支持转为非代理模式"),
    ADVERTISER_TYPE_NOT_LEGAL_ERROR(10016, "广告主类型不合法"),
    UNSUPPORTED_EARNEST_ERROR(10025,"不支持的充值(earnest)类型"),
    UNSUPPORTED_CURRENCY_TYPE_ERROR(10026,"不支持的货币类型"),
    PARAM_NOT_IN_RANGE(10027,"参数不在允许的指定范围内"),
    ORDER_TIME_NOT_IN_RANGE(10028, "订单时间不合法"),
    STATUS_IS_NULL(10029, "状态参数不能都为空"),
    STATUS_HAS_MANY(10030, "只能更新一种状态类型"),
    STATUS_IS_NOT_VALID(10031, "更新状态无效"),
    SMS_CODE_ERROR(10032, "验证码错误,请重新输入"),
    TOKEN_COUNT_ERROR(10033, "您今天发送短信次数过多,请明天再试"),
    UPGRADE_STATUS_NOT_LEGAL(10034, "kafka消费粉条升级状态不合法"),
    RATE_LIMIT_OVER(10035, "请求超出了限定次数"),
    MOBILE_COUNT_ERROR(10036, "您一天内最多只能使用2个手机号接收短信,请明天再试"),
    OVER_LIMIT_SIZE(10037, "字段名称最多查询100条"),

    //用户及账户相关错误码 20000开头
    USER_NOT_EXIST(20401, "用户不存在"),
    CONTRACT_NOT_EXIST(20402, "未查到合同信息"),
    SELF_ADVERTISER_NOT_EXIST(20403, "不是自助广告主类型"),
    AGENT_NOT_EXIST(20404, "代理商不存在"),
    MONEY_NOT_GT_ZERO(20405, "金额必须大于0"),
    MONEY_NOT_LEGAL(20406, "点数超过最大限制"),
    AGENT_ACCOUNT_NOT_EXIST(20407, "代理商账户不存在"),
    ADVERTISER_UN_PROTECTED_NOT_ACTIVE(20408, "广告主已掉保且非已激活状态不允许充值"),
    ADVERTISER_ACCOUNT_IS_EXIST(20409, "广告主账户已存在"),
    ACCOUNT_TYPE_NOT_EXIST(20410, "广告主账户类型不存在"),
    MUST_SELF_SERVICE(20411, "必须是自助广告客户"),
    AGENT_KILL(20412, "代理商被封杀"),
    AGENT_FREEZE(20413, "代理商被冻结"),
    REFUND_ORDER_OUT_OF_TIME(20414, "退款订单超过360天，请线下支持"),
    MONEY_HAS_SCALE(20415, "金额不能含有小数"),


    //业务相关错误码 30000开头
    HAS_EARNEST_TO_RECHARGE(30000, "不支持保证金充值"),
    BALANCE_REBATE_ALL_ZERO(30001, "不允许本金返点都为0"),
    TOO_MANY_AGENT_TO_CONTRACT(30002, "同一合同不能充值给多个代理商"),
    AGENT_TYPE_NOT_MATCH(30003, "代理商类型不匹配"),
    USER_IS_DELETED(30004, "用户已删除"),
    USER_IS_FROZEN(30005, "用户已冻结"),
    OLD_CONTRACT_NOT_MATCH_UPDATED_CONTRACT(30006, "原合同信息与更新合同信息不一致"),
    USER_TYPE_NOT_LEGAL(30007, "用户类型不合法"),
    USER_NOT_IN_WHITE_LIST(30008, "用户不在白名单内，请联系掘金系统添加白名单！"),
    USER_IN_WHITE_NOT_ALLOW_RECHARGE_TYPE(30009, "白名单用户不支持此充值方式"),
    ADVERTISER_ACCOUNT_STATUS_NOT_OPEN(30010, "用户未开户"),
    RECHARGE_NOT_CONSUMED(30011, "合同充值未消耗完，不允许KA充值"),
    AGENT_RECHARGE_TYPE_NOT_MATCH(30012, "代理商充值类型不匹配"),
    AGENT_DEDUCT_APPLY_FAIL(30013, "代理商追投扣缴申请失败"),
    BUSINESS_ORDER_NO_IS_NULL(30014, "业务流水号不能为空"),
    BUSINESS_ORDER_NO_IS_REPEAT(30015, "业务流水号重复"),
    AGENT_DEDUCT_APPLY_REPEAT_SUBMIT(30016, "代理商追投扣缴申请重复提交"),
    NOT_ACTIVE_UN_PROTECTED_ADVERTISER_CANT_RECHARGE(30017, "掉保非激活状态广告主不允许充值"),
    USER_TYPE_NOT_MATCH_RECHARGE_TYPE(30018, "账户类型与充值类型不匹配"),
    AGENT_RECHARGE_TYPE_NOT_LEGAL(30019, "代理商充值类型不合法"),
    ADVERTISER_UID_ERROR(30020, "请输入正确的UID"),
    SSO_INFO_NOT_FOUND_ERROR(30021, "未查询到用户登录名称相关信息"),
    USER_STATUS_CAN_RECHARGE_ERROR(30022, "用户状态异常，暂时无法充值，请在掘金系统查看用户状态！"),
    CREATE_ORDER_TYPE_NOT_LEGAL(30023, "当前账户不为粉条账户，不能创建订单"),
    ORDER_NOT_FOUND(30024, "原订单不存在"),
    TOO_MANY_UPGRADE_LOG(30025, "已存在粉条升级中记录"),
    REFUND_ORDER_NOT_MATCH_OLD_ORDER(30026, "退款订单与原订单不匹配"),
    OLD_ORDER_BALANCE_NOT_ENOUGH(30027, "原订单余额不足，无法退款"),
    OLD_ORDER_REFUND_ERROR(30028, "原订单正在操作，请稍后再次退款"),
    ORDER_CONSUMED_CAN_NOT_REFUND(30029, "原订单已结算不能退款"),
    ERROR_ORDER_ID(30030, "订单ID重复,但详细参数不同,请重新生成订单"),
    NO_FANS_CAN_NOT_UPGRADE(30031, "非超粉用户不能升级退款"),
    NO_ORDER_COUPON_RECORD(30032, "没有查询到原订单与体验券关系记录，不能退还体验券"),
    NO_COUPON_PROVIDE_RECORD(30033, "没有查询到匹配的体验券发放记录，不能退还体验券"),
    ORDER_CONSUMER_NOT_FOUND(30034, "订单不存在"),
    CUSTOMER_NOT_FOUND_ERROR(30035, "粉条账户不存在"),

    //资金相关错误码 40000开头
    AGENT_RECHARGE_NOT_FOUND(40000, "没有查询到代理商充值信息"),
    AGENT_RECHARGE_OVER_CONTRACT_LIMIT(40001, "代理商取消的充值金额大于合同金额"),
    DSP_NOT_REFUND(40002, "不支持DSP退款"),
    KA_NOT_REFUND(40003, "不支持KA退款"),
    AGENT_ACCOUNT_NO_POINT(40004, "账户余额不足"),
    AGENT_CONTRACT_NO_POINT(40005, "合同余额不足"),
    ADVERTISER_HAS_POINT(40006, "有余额，不能删除广告主账户"),
	AGENT_CONTRACT_REBATE_NO_POINT(40007, "合同金额与代理商账户不一致，合同钱不够"),
    AGENT_DEDUCT_IDEMPOTENT(40008, "同一时刻只能进行一笔资金操作，请稍后重试"),
    AGENT_DEDUCT_STATUS_PASS(40009, "扣款状态为已扣款，不能重复扣款"),
    ADVERTISER_TRANSACTION_CODE_REPEAT(40010, "充值交易流水号重复，无法完成充值"),
    AGENT_ACCOUNT_MONEY_NOT_ENOUGH(40011, "代理商账户余额不足"),
    CMS_NOT_RECHARGE(40012, "不支持cms代理广告主充值"),
    HAS_BALANCE_NOT_TRANSFER(40013, "账户余额大于零不能转户"),
    SELF_TRANSFER_NOT_RECHARGE(40014, "自助广告主流转中不能充值"),
    AGENT_ACCOUNT_NOT_SUFFICIENT_FUND(40015, "代理商账户可用余额不足"),
    AGENT_ACCOUNT_NOT_PDS(40016, "代理商账户非PDS帐户"),
    AGENT_ACCOUNT_TYPE_NOT_EQUAL(40017, "代理商和代理账户类型不相等"),
    AGENT_ACCOUNT_REFUND_MINUS(40018, "代理商退款额小于0"),
    AGENT_ACCOUNT_CONTRACT_NOT_SUFFICIENT_FUND(40019, "代理商账户合同帐户可用余额不足"),
    AGENT_ACCOUNT_CONTRACT_NOT_FOUND(40020, "代理商账户合同帐户不存在"),
    AGENT_ACCOUNT_CONTRACT_NOT_EQUAL(40021, "代理商帐户余额不等于代理商合同余额"),
    AGENT_ACCOUNT_UID_ERROR(40022, "请输入代理商UID"),
    AGENT_TRANSFER_NOT_EQUAL_CONSUME(40023, "PDS代理商转出金额不等于代理商消耗金额,无法退款"),
    AGENT_ACCOUNT_PRINCIPAL_GT_TOTAL(40024, "PDS代理商的本金余额大于总余额"),
    ACTIVITY_NAME_REPEAT(40025, "活动名称重复"),
    CUSTOMER_BALANCE_NO_POINT(40026, "粉条账户余额不足"),

    //系统异常和对外接口服务相关错误码 50000开头
    API_SERVICE_ERROR(50000, "服务器接口异常"),
    FEIGN_SERVICE_ERROR(50001, "Feign接口异常"),
    API_PARAM_NOT_LEGAL(50002, "请求参数不正确"),
    API_CHECK_SIGN_FAIL(50003, "校验参数签名未通过"),
    TENMA_RECHARGE_ERROR(50004, "结算引擎充值接口出错"),
    BP_RECHARGE_ERROR(50005, "调用bp充值接口出错"),
    REPEAT_SUBMIT(50006, "重复提交"),
    MIS_REFUND_ERROR(50007, "调用mis退款接口出错"),
    REPEAT_ORDER(50008, "order_id不能重复"),
    ACCOUNT_HAS_CONSUME(50009, "该账户48小时内有消耗，无法退款"),
    RECHARGE_ISNOT_ENOUGH(50010, "该广告主充值流水金额不足，不能退款！"),
    HAS_NO_ENOUGH_REBATE(50011, "该账户内的返点不足，不能退款"),
    COUPON_BALANCE_NO_ZERO(50012, "体验券余额不为0,不能发起退款"),
    REFUND_POINT_ERROR(50013, "退款金额输入不正确"),
    ADVERTISER_NO_POINT(50014, "账户余额不足"),
    HAS_CONSUME(50015, "该账户24小时内有消耗，无法退款"),
    HAS_REALTIME_CONSUME(50016, "该账户有实时消耗"),
    LESS_THAN_MIN_POINT(50017, "有消耗且余额小于退款金额最低额度"),
    CHANNEL_CANNOT_REFUND(50018, "拥有特殊渠道充值,请找管理员确认"),
    ADVERTISER_NO_ACCOUNT_DATA(50019, "无法查询到广告主账户信息"),
    SYSTEM_SETTLEMENT(50020, "系统结算中，禁止操作"),
    ADVERTISER_NO_DATA(50021, "无法查询到广告主账户信息"),
    ADVERTISER_HAS_REAL_CONSUME(50022, "引擎存在实时消耗，无法退款！"),
    ADVERTISER_UNEQUAL_ENGINE(50023, "账户余额与引擎余额不一致，无法退款！"),
    FROM_NO_ADVERTISER(50024, "转出用户不存在"),
    BP_ACCOUNT_CHANGE_ERROR(50025, "调用bp接口出错"),
    REDIS_LOCK_FAIL(50026, "系统异常，分布式锁加锁失败"),
    FEIGN_SERVICE_RESULT_IS_NULL(50027, "Feign接口返回参数为空"),
    CANNOT_REFUND_WEIBO_PAY_ORDER(50028, "您的微博支付订单已超过360天，请使用对公转账进行退款!"),
    WEIBO_PAY_API_ERROR(50029, "微博支付接口调用异常"),
    WEIBO_PAY_API_QUERY_REFUND_FAIL(50030, "微博支付1.0退款查询接口调用成功，但是未查询到此订单"),
    OPERATE_TYPE_ILLEGAL(50031, "操作类型不合法"),
    SSO_INFO_ERROR(50032, "sso获取用户信息接口调用失败"),

    UC_ID_NOT_EXIST(60001, "用户ID不存在"),
    UC_USER_NOT_AUTHORIZED(60002, "用户未授权,请联系管理员！"),
    UC_GET_USER_ERROR(60003, "获取用户信息失败"),
    UC_GET_ORG_ERROR(60004, "获取机构信息失败"),
    UC_GET_ROLE_ERROR(60005, "获取当前角色失败"),
    UC_GET_STATUS_KILL(60006, "当前用户被封杀"),
    UC_GET_STATUS_FREEZE(60007, "当前用户被冻结"),
    UC_GET_USER_SESSION_ERROR(60008, "请求异常或会话过期！请重新登陆！"),
    FORBIDDEN(60009, "无访问权限"),
    UC_ACCOUNT_NOT_EXIST(60010, "帐号UID未在UC系统注册,请联系管理员"),
    MANAGE_ROLE_NOT_EXIST(60011, "帐号未配置角色,请联系管理员"),

    ;

    private int code;

    private String msg;


    ErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

}
